home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Panorama
/
Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].zip
/
Panorama - Disk 01 (1986-02-15)(Pacific North-West Amigas Club)[h AFL][b corrupt files].adf
/
pipe.doc
< prev
next >
Wrap
Text File
|
1989-10-24
|
4KB
|
110 lines
PIPE
Pipe - program to connect the output of one program to the input of
another.
Syntax
Pipe [@] pgm1 [@o] [file] [options] | pgm2 [@<][@o][@s] [options]...| \
pgmn [@<] [file] [options]
Description
A pipe is a temporary RAM file that is created by one program and passed
as information to another program. This file is entirely controlled by
the program Pipe and is transparent to the user. This eliminates the
need for the user to create temporary files to pass information to other
programs. Pipe effectively turns most commands and programs into
MS-DOS/XENIX-like filters - ie - they take standard input
(keyboard) and standard output (screen). It's left to the users' in-
genuity to find effective uses.
Pipe is capable of handling not only standard input and output, but
command line input and output. Pipe knows CLI requirements (version
1.1). For other programs, the default is command line input and
standard output. Either or both may be changed with command line
options. Program name followed by @< changes the input for that pro-
gram to redirected standard input (file as opposed to keyboard).
@o changes the output of the program to command line output. @s indi-
cates the output is the same file as the input, such as the i/o of Ed.
They may be specified separately - eg - @< @o, or together - eg - @<o.
If specified separately, spaces must be inserted between them. In add-
ition, these options must appear immediately following the program
name. For any non-CLI command (last in the pipeline) having command
line output, this may be redirected to the screen by specifying *.
@ immediately following the Pipe command itself will list the
commands as they execute.
Programs are separated by (space) | (space). The user, where applic-
able, must specify the input of the first program and the output of
the last program in the pipeline. If no output for the last is spec-
ified, the default will be the screen. There may be no "input" spec-
ified for some commands, such as Dir and List. Standard command options
may be entered, but must follow input for the first command in the pipe
line and output for the last command. Input and output names may NOT
be specified for commands and programs enclosed by | (vertical bar) -
that is handled by Pipe itself and is transparent to the user. A temp-
orary RAM file for the last command may be created by using a closing
|. In this case, the file "RAM:pipetemp" will be created.
After the final command, Pipe deletes any temporary files (exept RAM:
pipetemp) created previously, thus relieving the user of tracking
and deleting temporary files that would have to be created if the
commands were run separately.
Some commands are more useful than others for piping; for example -
it makes no sense whatsoever to use the Copy command, unless you get
off on watching the disk drive light flicker. Following is a list of
allowable CLI commands and their constraints.
s = standard i/o; c = command line i/o.
COMMAND INPUT OUTPUT MUST BE: FIRST or LAST (not filters)
ASSIGN s x
COPY c c
DATE c&s x
DELETE s x
DIR c&s x
INFO s x
INSTALL s x
JOIN c c
LIST s x
MORE c c x
SEARCH c s
SORT c c
STATUS s x
TEE c (cannot be first)
TYPE c c&s x
Examples
pipe @ list | sort | more
The output of list is passed to sort, which is sorted and passed to
standard output a screenfull at a time. The commands are listed as
they execute.
pipe search myfile "for any string" | MyProg @<o | type prt: opt n
The output of search is passed to MyProg, which accepts both redirected
input and command line output, massaged and passed to type, which
produces a line numbered listing to the printer.
pipe MyProg myfile | join b c | sort
MyProg uses myfile as command line input, the output is passed to join,
which concatenates b and c to same and passes the resulting output to
sort, which lists the sorted file to the screen.
pipe dir c | wc -w
Lists the number of commands in the c directory.
pipe dir opt d | wc -l
Lists the number of directories immediately subordinate to the current
directory.